-- GENERATED SPELL FOR [Shade of Hakkar] --


function spell0_8440(pUnit, Event) --@Cause Insanity,n/a--
pUnit:FullCastSpellOnTarget(12888,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_8440', 6275, 1)
end

function spell1_8440(pUnit, Event) --@Curse of Tongues,n/a--
pUnit:FullCastSpellOnTarget(12889,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_8440', 15342, 1)
end

function spell2_8440(pUnit, Event) --@Lash,n/a--
pUnit:FullCastSpellOnTarget(6607,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_8440', 1000, 1)
end

function spell3_8440(pUnit, Event) --@Summon Hakkar,n/a--
pUnit:FullCastSpellOnTarget(12639,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_8440', 643, 1)
end

function Sorts_8440(pUnit, Event)
local choix_sorts_8440 = math.random(0, 3)
if choix_sorts_8440 == 0 then
pUnit:RegisterEvent('spell0_8440', 1, 1)
end
if choix_sorts_8440 == 1 then
pUnit:RegisterEvent('spell1_8440', 1, 1)
end
if choix_sorts_8440 == 2 then
pUnit:RegisterEvent('spell2_8440', 1, 1)
end
if choix_sorts_8440 == 3 then
pUnit:RegisterEvent('spell3_8440', 1, 1)
end
end

function mob8440_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_8440', math.random(1500, 3000), 1)
end

function mob8440_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob8440_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob8440_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(8440, 1, 'mob8440_Action')
RegisterUnitEvent(8440, 2, 'mob8440_Leave')
RegisterUnitEvent(8440, 3, 'mob8440_Kill')
RegisterUnitEvent(8440, 4, 'mob8440_Die')
